#include <vector>
#include <unordered_map>

class Solution {
public:
    std::vector<int> twoSum(std::vector<int>& nums, int target) {
        int n = nums.size();
        std::unordered_map<int, int> numMap;
        for (int i = 0; i < n; ++i) {
            int complement = target - nums[i];
            if (numMap.count(complement)) {
                return {numMap[complement], i};
            }
            numMap[nums[i]] = i;
        }
        return {};
    }
};


#include <iostream>

int main() {
    std::vector<int> nums = {2, 7, 11, 15};
    int target = 9;

    Solution solution;
    std::vector<int> result = solution.twoSum(nums, target);

    std::cout << "Indices: " << result[0] << ", " << result[1] << std::endl;

    return 0;
}
